//
//  MHOrderListCell.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/7/26.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHOrderListCell.h"
#import "MHOrderListItemViewModel.h"

@implementation MHOrderListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.contentLabel.font = MHRegularFont_14;
    self.timeLabel.font = MHRegularFont_11;
    self.incomeLabel.font = MHRegularFont_18;
    self.orderLabel.font = MHRegularFont_14;
    self.statusLabel.font = MHRegularFont_11;
    self.resonLabel.font = MHRegularFont_11;
    self.resonLabel.textColor =  [UIColor colorFromHexString:@"#FF5100"];
}

-(void)bindViewModel:(MHOrderListItemViewModel *)viewModel
{
    self.timeLabel.text = viewModel.model.date;
    self.orderLabel.text = [NSString stringWithFormat:@"交易订单号:%@",viewModel.model.orderNo];
    self.contentLabel.text = viewModel.model.info;
    self.incomeLabel.text = [NSString stringWithFormat:@"%.2f",viewModel.model.amount];
    
    if(viewModel.model.status == 3)
    {
        self.statusLabel.text = @"失败";
        
    }else
    {
        if (viewModel.model.status == 1) {
            self.statusLabel.text = @"待处理";
        }else if (viewModel.model.status == 2)
        {
            self.statusLabel.text = @"已处理";
        }else {
            self.statusLabel.text = @"已驳回";
        }
        
    }
    
    self.resonLabel.text = viewModel.model.errorMgs;
    
    if (viewModel.model.status == 2) {
        self.statusLabel.textColor = MHMetionTextColor;
    }else
    {
        self.statusLabel.textColor = [UIColor colorFromHexString:@"#FF5100"];
    }
    
    
}


@end
